﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Resources;
using System.Text;
using System.Windows.Forms;

namespace Cluster.JeJePoster
{
    public partial class AddUserForm : Form
    {
        readonly ResourceManager resources = new ResourceManager("JeJePoster.Languages", Assembly.GetExecutingAssembly());
        private readonly bool EditMode;
        public AddUserForm(bool editMode)
        {
            InitializeComponent();
            EditMode = editMode;
        }

        private void menuItemOk_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void menuItemCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void checkBoxSavePassword_CheckStateChanged(object sender, EventArgs e)
        {
            checkBoxAutoLogin.Enabled =
                checkBoxSavePassword.Checked;
            if (!checkBoxSavePassword.Checked)
            {
                checkBoxAutoLogin.Checked = false;
            }
            if (EditMode) textBoxPassword.Enabled = checkBoxSavePassword.Checked;
        }
    }
}